home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 14
/
Mac Magazin and MacEasy Magazine CD - Issue 14.iso
/
Wissenschaft & Technik
/
StandardGetFolder 2.0
/
StandardGetFolder.h
next >
Wrap
Text File
|
1995-07-04
|
3KB
|
95 lines
/****************************************************************************************************
StandardGetFolder.h -- Copyright Chris Larson, 1993 - 1994 -- All rights reserved.
Based partly upon a StandardGetFolder example by Steve Falkenburg (MacDTS)
and partly on the code in Inside Macintosh: Files.
Dialog box layouts taken from Inside Macintosh: Files.
Include this file in your #includes to use StandardGetFolder.
Bug Reports/Comments to larson@kingston.cs.ucla.edu
Version 2.0
Usage Rules: This package (source code and compiled derivatives) may be used in any shareware
product (or other such stuff: freeware, beerware, postcardware, etc.) as long as you
mention me in your credits. (A registered copy of whatever you write wouldn’t hurt
either ;-) This package is _not_ in the public domain and may _not_ be used in any
public domain product in any fashion. This package may not be used in any commercial
product without the expressed, written consent of the author.
****************************************************************************************************/
#ifndef __STANDARDGETFOLDER__
#define __STANDARDGETFOLDER__
// ----------
// Constants
// ----------
#define kSGFHideNewFolderButton 0x0010
#define kSGFNeedSearchPrivs 0x0001
#define kSGFNeedReadPrivs 0x0002
#define kSGFNeedWritePrivs 0x0004
#define kSGFSelectDropFolder kSGFNeedWritePrivs
#define kSGFNeedAllPrivs ( kSGFNeedSearchPrivs + kSGFNeedReadPrivs + kSGFNeedWritePrivs )
#define kSGFDefaultFlags kSGFNeedAllPrivs
// ----------
// Type Declarations
// ----------
#pragma options align=mac68k
typedef struct {
short sfGood;
short sfVRefNum;
long sfDirID;
} StandardFolderReply, *StandardFolderReplyPtr, **StandardFolderReplyHandle;
#pragma options align=reset
// ----------
// Definitions for the callback event handling function.
// ----------
typedef pascal void (*WindowEventHandler)(EventRecord*);
#if GENERATINGCFM
typedef UniversalProcPtr WindowEventHandlerUPP;
#else
typedef WindowEventHandler WindowEventHandlerUPP;
#endif
enum {
uppWindowEventHandlerProcInfo = kPascalStackBased
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventRecord*)))
};
#if GENERATINGCFM
#define NewWindowEventHandlerProc(userRoutine) (WindowEventHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowEventHandlerProcInfo, GetCurrentArchitecture())
#define CallWindowEventHandler(userRoutine,theEventPtr) (void)CallUniversalProc((UniversalProcPtr)(userRoutine),uppWindowEventHandlerProcInfo,(theEventPtr))
#else
#define NewWindowEventHandlerProc(userRoutine) ((WindowEventHandlerUPP)(userRoutine))
#define CallWindowEventHandler(userRoutine,theEventPtr) (*(userRoutine))((theEventPtr))
#endif
// ----------
// Function Prototypes
// ----------
#ifdef __cplusplus
extern "C" {
#endif
pascal OSErr StandardGetFolder(ConstStr255Param prompt, StandardFolderReplyPtr reply, short flags, WindowEventHandlerUPP windowEventProc);
#ifdef __cplusplus
}
#endif
#endif